package com.system.common.config;

import com.system.common.util.OrderNoGenerator;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.StringRedisTemplate;


@Configuration
public class OrderNoGeneratorConfig {
    @Bean
    @ConditionalOnBean(StringRedisTemplate.class)
    public OrderNoGenerator orderNoGenerator(StringRedisTemplate stringRedisTemplate) {
        return new OrderNoGenerator(stringRedisTemplate, 1L, 1L);
    }
}

